{% extends "root/templates/base.html" %}

{% block content %}
<h2>Find individual</h2>
<div class="info">
  Search for a single person. Type in a name, e-mail, or phone number.
</div>

<form id="search" method="POST">
  <input type="text" name="lookups" />
  <input type="submit" submit="Find">
</form>

{% if results %}
<table class="people_list">
  {% for result in results %}
  {% ifchanged result.fieldset_key %}
  <tr>
    {% for field in result.fieldset.fields_list %}
    <th>{{ field.verbose_name }}</th>
    {% endfor %}
    <th>More</th>
  </tr>
  {% endifchanged %}
  <tr class="{% cycle alt1,alt2 %}">
    {% for value in result.to_list %}<td>
      {{ value|property_print }}
    </td>{% endfor %}
    <td><a href="/people/valueset?primary_key={{ result.primary_key }}">View / Edit</a></td>
  </tr>
  {% endfor %}
</table>
{% endif %}

<div class="result_count">
  {% if results %}{{ results|length }} entries found.{% endif %}
  <a href="/people/valueset">Create New?</a>
</div>

{% endblock %}
